package com.hdaccp.hadoop.hdfs;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

public class Demo2 {
    /**
     * 从linux系统上传文件到hdfs上
     * @param args
     */
    public static void main(String[] args) throws  Exception{
        //
       String srcPath = args[0] ;
        //
       String disPath= args[1] ;
        //
        Configuration cfg = new Configuration() ;

        FileSystem fileSystem = FileSystem.get(cfg) ;

        Path path1 = new Path(srcPath) ;
        Path path2 = new Path(disPath) ;

        fileSystem.copyFromLocalFile(path1,path2);

    }
}
